<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js">&quot;use strict&quot;;
Object.defineProperty(exports, &quot;__esModule&quot;, { value: true });
exports.PhoneMatch = void 0;
var tslib_1 = require(&quot;tslib&quot;);
var abstract_match_1 = require(&quot;./abstract-match&quot;);
<span id='Autolinker-match-Phone'>/**
</span> * @class Autolinker.match.Phone
 * @extends Autolinker.match.AbstractMatch
 *
 * Represents a Phone number match found in an input string which should be
 * Autolinked.
 *
 * See this class&#39;s superclass ({@link Autolinker.match.Match}) for more
 * details.
 */
var PhoneMatch =  (function (_super) {
    (0, tslib_1.__extends)(PhoneMatch, _super);
<span id='Autolinker-match-Phone-method-constructor'>    /**
</span>     * @method constructor
     * @param {Object} cfg The configuration properties for the Match
     *   instance, specified in an Object (map).
     */
    function PhoneMatch(cfg) {
        var _this = _super.call(this, cfg) || this;
<span id='Autolinker-match-Phone-property-type'>        /**
</span>         * @public
         * @property {&#39;phone&#39;} type
         *
         * A string name for the type of match that this class represents. Can be
         * used in a TypeScript discriminating union to type-narrow from the
         * `Match` type.
         */
        _this.type = &#39;phone&#39;;
<span id='Autolinker-match-Phone-property-number'>        /**
</span>         * @protected
         * @property {String} number (required)
         *
         * The phone number that was matched, without any delimiter characters.
         *
         * Note: This is a string to allow for prefixed 0&#39;s.
         */
        _this.number = &#39;&#39;; // default value just to get the above doc comment in the ES5 output and documentation generator
<span id='Autolinker-match-Phone-property-plusSign'>        /**
</span>         * @protected
         * @property  {Boolean} plusSign (required)
         *
         * `true` if the matched phone number started with a &#39;+&#39; sign. We&#39;ll include
         * it in the `tel:` URL if so, as this is needed for international numbers.
         *
         * Ex: &#39;+1 (123) 456 7879&#39;
         */
        _this.plusSign = false; // default value just to get the above doc comment in the ES5 output and documentation generator
        _this.number = cfg.number;
        _this.plusSign = cfg.plusSign;
        return _this;
    }
<span id='Autolinker-match-Phone-method-getType'>    /**
</span>     * Returns a string name for the type of match that this class represents.
     * For the case of PhoneMatch, returns &#39;phone&#39;.
     *
     * @return {String}
     */
    PhoneMatch.prototype.getType = function () {
        return &#39;phone&#39;;
    };
<span id='Autolinker-match-Phone-method-getPhoneNumber'>    /**
</span>     * Returns the phone number that was matched as a string, without any
     * delimiter characters.
     *
     * Note: This is a string to allow for prefixed 0&#39;s.
     *
     * @return {String}
     */
    PhoneMatch.prototype.getPhoneNumber = function () {
        return this.number;
    };
<span id='Autolinker-match-Phone-method-getNumber'>    /**
</span>     * Alias of {@link #getPhoneNumber}, returns the phone number that was
     * matched as a string, without any delimiter characters.
     *
     * Note: This is a string to allow for prefixed 0&#39;s.
     *
     * @return {String}
     */
    PhoneMatch.prototype.getNumber = function () {
        return this.getPhoneNumber();
    };
<span id='Autolinker-match-Phone-method-getAnchorHref'>    /**
</span>     * Returns the anchor href that should be generated for the match.
     *
     * @return {String}
     */
    PhoneMatch.prototype.getAnchorHref = function () {
        return &#39;tel:&#39; + (this.plusSign ? &#39;+&#39; : &#39;&#39;) + this.number;
    };
<span id='Autolinker-match-Phone-method-getAnchorText'>    /**
</span>     * Returns the anchor text that should be generated for the match.
     *
     * @return {String}
     */
    PhoneMatch.prototype.getAnchorText = function () {
        return this.matchedText;
    };
    return PhoneMatch;
}(abstract_match_1.AbstractMatch));
exports.PhoneMatch = PhoneMatch;
//# sourceMappingURL=phone-match.js.map</pre>
</body>
</html>
